﻿Imports OMANE.Common.UI

Public Class ViewRessources

End Class

Public Class ViewModelRessources
    Implements IViewModelTabSection


    Sub New()
        Icone = StandardIcons.BLOG
    End Sub

    Public ReadOnly Property Ressources As IEnumerable
        Get
            Return ModuleDashboarding._activeproject.Ressources
        End Get
    End Property


    Public Property Icone As String Implements IViewModelTabSection.Icone

    Public Property Title As String Implements IViewModelTabSection.Title

    Public Property IsClosable As Boolean Implements IViewModelTabSection.IsClosable
End Class


Public Class ViewRessourcesTemplateSelector
    Inherits Windows.Controls.DataTemplateSelector

    Public Overrides Function SelectTemplate(ByVal item As Object, ByVal container As System.Windows.DependencyObject) As System.Windows.DataTemplate
        If item Is Nothing Then Return MyBase.SelectTemplate(item, container)
        If item.Value Is Nothing Then Return MyBase.SelectTemplate(item, container)
        Dim result = ModuleDashboarding._propertyGridDictionary(item.Value.GetType().Name & "CellTemplate")
        If result IsNot Nothing Then Return result
        result = ModuleDashboarding._propertyGridDictionary(item.Value.GetType().BaseType.Name & "CellTemplate")
        If result IsNot Nothing Then Return result
        Return ModuleDashboarding._propertyGridDictionary("DefaultCellTemplate")
    End Function
End Class